<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box">

    </div>

    <script src="./js/react18.js"></script>
    <script src="./js/react-dom18.js"></script>
    <script src="./js/babel.min.js"></script>
    <script src="./js/prop-types.js"> </script>

    <script type="text/babel">

        // 创建一个根对象：
        let root = ReactDOM.createRoot(document.getElementById("box"));


        class MyPerson extends React.Component {

            constructor(props) {
                super();
            }

            
            render() {
                console.log("this.props.children",this.props.children);
                return (
                    <div>
                        <h1>状态机</h1>
                        <div>第一个div</div>
                        {this.props.children}
                        <div>第二个div</div>
                    </div>
                )
            }
        }

        const jsx = (
            <div>
                <MyPerson>
                    <div>
                        <span>1</span>
                        <span>2</span>
                    </div>
                    </MyPerson>
            </div>)


        // 把jsx渲染到根对象对应的dom容器里
        root.render(jsx);


    </script>
</body>

</html>